package com.cupster.android_x_frame;

import android.app.Application;
import android.os.Build;

import java.io.File;

public class AndroidFilePathHelper {

    public static String getInternalAppDataPath(Application application) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
            return application.getApplicationInfo().dataDir;
        }
        return getAbsolutePath(application.getDataDir());
    }
    private static String getAbsolutePath(final File file) {
        if (file == null) return "";
        return file.getAbsolutePath();
    }
}
